<div id="docliste">
<?php
	if ($ticket['Document'])
		echo __('linked_documents')." :";
	foreach ($ticket['Document'] as $document) {
		echo $html->image('/document_ext/'.$document['extention'].'.png', array('alt'=>"", 'border'=>"0", 'width'=>"22",'height'=>"22" ));
		echo $link->projectLink($project_id, $project_name, $document['name'], '/documents/download/'. $document['id']).' ';
	}
?>
</div>
<div id="addpiece" class="largebloc2">
<h3>Ajouter un document</h3>
<?php echo $form->create('Document', array('action' => 'add2', 'type'=>'file')); ?>
<?php //echo $ajax->form(null, 'post'); ?>
<table width="100%" border="0" cellspacing="2" cellpadding="0">
  <tr>
    <td width="90"><?php echo $form->label(__('file', true)); ?></td>
    <td><?php echo $form->file('File'); ?></td>
  </tr>
  <tr>
    <td width="90"><?php echo $form->label(__('name', true)); ?></td>
    <td><?php echo $form->text('Document.name'); ?></td>
  </tr>
  <tr>
    <td width="90"><?php echo $form->label('Description'); ?></td>
    <td><?php echo $form->textArea('Document.description'); ?>	
		<?php echo $form->hidden('Document.project_id', array ('value' => $ticket['Ticket']['project_id'])); ?>
        <?php echo $form->hidden('project_name', array ('value' => $project_name)); ?>
		<?php echo $form->hidden('Document.ticket_id', array ('value' => $ticket['Ticket']['id'])); ?>
		<?php echo $form->hidden('Document.access', array ('value' => 2)); ?>
    </td>
  </tr>
  <tr>
    <td width="90"><?php echo $ajax->submit(__('upload', true), array('url' => 'add2', 'update'=>'add_doc', 'div'=> false)); ?></td>
    <td>&nbsp;</td>
  </tr>
</table>
<?php echo $form->end(); ?>
</div>